[watch] Static web asset abstraction#55188
Merged
Merged
Conversation
fa4130e to
398b830
Compare
420b65b to
cfeb364
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors dotnet-watch static web asset hot reload to use a shared abstraction (StaticWebAssetUpdateBuilder) and centralizes static asset manifest filtering logic, with new unit tests covering scoped CSS and asset-path behaviors.
Changes:
- Introduces
StaticWebAssetUpdateBuilderand moves static asset update graph-walking logic into a reusable component. - Adds
StaticWebAssetsManifest.GetFilesToWatch()and updates evaluation to use it (including filtering rules). - Adds new unit tests for static web asset path helpers and multi-project update scenarios.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.DotNet.HotReload.Client.Tests/StaticWebAssetUpdateBuilderTests.cs | New tests covering update propagation across project graphs and scoped CSS bundle regeneration scenarios. |
| test/Microsoft.DotNet.HotReload.Client.Tests/StaticWebAssetTests.cs | New tests for StaticWebAsset helper methods (scoped CSS, bundles, compression, relative URL generation). |
| src/Dotnet.Watch/Watch/UI/IReporter.cs | Switches predefined test messages to use LogEvents entries for static web asset warnings. |
| src/Dotnet.Watch/Watch/HotReload/ProjectUpdatesBuilder.StaticWebAssets.cs | Extracts static asset update handling into a new partial file using StaticWebAssetUpdateBuilder. |
| src/Dotnet.Watch/Watch/HotReload/ProjectUpdatesBuilder.cs | Makes ProjectUpdatesBuilder partial and removes the inlined static asset update implementation. |
| src/Dotnet.Watch/Watch/Build/ProjectGraphUtilities.cs | Adjusts assembly name helper to extend ProjectInstance and adds ProjectInstanceId helpers. |
| src/Dotnet.Watch/Watch/Build/LoadedProjectGraph.cs | Adds a GetProjectNode(ProjectInstanceId) helper for retrieving graph nodes by project+TFM. |
| src/Dotnet.Watch/Watch/Build/EvaluationResult.cs | Uses StaticWebAssetsManifest.GetFilesToWatch() when adding watched static asset files. |
| src/Dotnet.Watch/HotReloadClient/Web/StaticWebAssetUpdateBuilder.cs | Adds the new abstraction for building per-application static asset updates + scoped CSS regeneration tracking. |
| src/Dotnet.Watch/HotReloadClient/Web/StaticWebAssetsManifest.cs | Adds GetFilesToWatch() to encapsulate filtering of manifest entries. |
| src/Dotnet.Watch/HotReloadClient/Web/StaticWebAsset.cs | Updates helper methods for case-insensitive extensions, adds OS-specific path comparison, and adds _content/ URL detection. |
| src/Dotnet.Watch/HotReloadClient/ProjectInstanceId.cs | Moves ProjectInstanceId into the HotReload namespace and enables nullable. |
| src/Dotnet.Watch/HotReloadClient/Logging/LogEvents.cs | Adds new log events for missing static web asset manifest and scoped CSS bundle file. |
cfeb364 to
49ebfc8
Compare
DustinCampbell
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
StaticWebAssetUpdateBuilderto HotReload.Client package so that we can reuse the logic of updating static web assets across all clients.Fix a couple of issues: